package com.huashi.dealer.modular.business.cart.param;

import com.huashi.dealer.commonEntity.GoodsSku;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

/**
 * API购物车响应参数
 *
 * @author 谭陈强
 * @since 2025-07-30
 */
@Data
@Schema(description = "API购物车响应参数")
public class CartResponseParam {


    @Schema(description = "购物车商品列表")
    private List<CartGoodsInfo> goodsList;

    @Schema(description = "购物车商品总数量")
    private Integer cartTotalNum;

    @Schema(description = "购物车总金额")
    private BigDecimal cartTotalPrice;

    @Schema(description = "购物车商品数量")
    private Integer cartCount;

    @Schema(description = "购物车ID")
    private Long cartId;

    @Schema(description = "用户ID")
    private Long userId;

    @Schema(description = "分类类型：10普通订单，30返利订单，40核销订单")
    private Integer isGoodsType;

            @Schema(description = "创建时间")
        private LocalDateTime createTime;

        @Schema(description = "更新时间")
        private LocalDateTime updateTime;

        @Schema(description = "购物车创建时间")
        private Long cartCreateTime;

    @Data
    @Schema(description = "购物车商品信息")
    public static class CartGoodsInfo {

        @Schema(description = "商品SKU")
        private GoodsSku goodsSku;

        @Schema(description = "购物车ID")
        private Long cartId;

        @Schema(description = "商品ID")
        private Long goodsId;

        @Schema(description = "商品SKU ID")
        private Long goodsSkuId;

        @Schema(description = "商品名称")
        private String goodsName;

        @Schema(description = "商品图片")
        private String goodsImage;

        @Schema(description = "商品价格")
        private BigDecimal goodsPrice;

        @Schema(description = "划线价格")
        private BigDecimal linePrice;

        @Schema(description = "商品规格")
        private String goodsSpec;

        @Schema(description = "库存数量")
        private Integer stockNum;

        @Schema(description = "商品数量")
        private Integer goodsNum;

        @Schema(description = "用户ID")
        private Long userId;

        @Schema(description = "商品总价")
        private BigDecimal goodsTotalPrice;

        @Schema(description = "商品分类ID")
        private Long categoryId;

        @Schema(description = "商品卖点")
        private String sellingPoint;

        @Schema(description = "商品条形码")
        private String barCode;

        @Schema(description = "商品规格类型：10单规格，20多规格")
        private Integer specType;

        @Schema(description = "库存计算方式：10下单减库存，20付款减库存")
        private Integer deductStockType;

        @Schema(description = "商品排序")
        private Integer goodsSort;

        @Schema(description = "配送模板ID")
        private Long deliveryId;

        @Schema(description = "是否开启积分赠送：1开启，0关闭")
        private Integer isPointsGift;

        @Schema(description = "是否允许使用积分抵扣：1允许，0不允许")
        private Integer isPointsDiscount;

        @Schema(description = "是否开启等级权益：1开启，0关闭")
        private Integer isEnableGrade;

        @Schema(description = "是否独立等级权益：1是，0否")
        private Integer isAloneGrade;

        @Schema(description = "独立等级权益")
        private String aloneGradeEquity;

        @Schema(description = "是否独立经销商：1是，0否")
        private Integer isIndDealer;

        @Schema(description = "经销商金额类型")
        private Integer dealerMoneyType;

        @Schema(description = "一级金额")
        private BigDecimal firstMoney;

        @Schema(description = "二级金额")
        private BigDecimal secondMoney;

        @Schema(description = "三级金额")
        private BigDecimal thirdMoney;

        @Schema(description = "商品状态")
        private Integer goodsStatus;

        @Schema(description = "商品类型")
        private Integer isType;

        @Schema(description = "商品内容")
        private String content;

        @Schema(description = "创建时间")
        private LocalDateTime createTime;

        @Schema(description = "更新时间")
        private LocalDateTime updateTime;

        @Schema(description = "购物车创建时间")
        private Long cartCreateTime;

        // 优惠活动相关字段
        @Schema(description = "是否参与活动：0-不参与，1-参与活动，2-活动未满足条件")
        private Integer isActiveGoods;

        @Schema(description = "活动价格")
        private java.math.BigDecimal activePrice;

        @Schema(description = "起订数量")
        private Integer setNum;

        @Schema(description = "优惠活动ID")
        private Long discountId;

        @Schema(description = "优惠活动状态")
        private Integer discountActiveStatus;

        @Schema(description = "活动商品总数量")
        private Integer newActiveGoodsNum;

        @Schema(description = "优惠活动信息")
        private Object activeDiscount;

        @Schema(description = "优惠活动基本信息")
        private Object activeInfo;

        @Schema(description = "优惠活动规格列表")
        private java.util.List<Object> activeDiscountSpec;

        @Schema(description = "优惠活动规格信息")
        private Object activeSpec;
    }
} 